import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: "/",
    redirect: "/home"
  },
  {
    path: '/home',
    name: 'home',
    component: HomeView,
    redirect: "/home/index",
    children: [
      {
        path: 'index',
        component: () => import('../views/indexView.vue')
      },
       {
        path: 'fenlei',
        component: () => import('../views/FenLei.vue')
      },
       {
        path: 'biaoqian',
        component: () => import('../views/BiaoQian.vue')
      },
       {
        path: 'guidang',
        component: () => import('../views/GuiDang.vue')
      },
    ]
  },
  {
    path: '/about',
    name: 'about',
    component: () => import('../views/AboutView.vue')
  },
  {
    path: '/login',
    component: () => import('../views/LoginView.vue')
  },

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
